package com.jackrain.nea.clould.dao;

import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.jackrain.nea.util.Tools;
import com.jackrain.nea.web.query.QueryEngine;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

/**
 * 查询key
 */
@Slf4j
@Component
public class PlantDao {


    /**
     * 查询ID
     *
     * @param plantNO
     * @return
     * @throws Exception
     */
    public int queryID(String plantNO, int clientID) throws Exception {

        String sql = "select id " +
                " from oms_plant" +
                " where oms_plant.NO = ? and ad_client_id = ?";

        int id = Tools.getInt(QueryEngine.getInstance().doQueryOne(sql, new Object[]{plantNO, clientID}), -1);

        return id;
    }


}
